<!DOCTYPE html>
<html>

<!-- Head -->

<head>
    <title></title>

    <!-- Meta-Tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<!-- //Head -->

<!-- Body -->

<body>

</body>
<!-- //Body -->

<script src="js/jquery-1.11.1.js"></script>
<script src="js/jquery-cookie-1.4.1.js"></script>
<script src="js/vue-2.6.11.js"></script>
<script src="js/axios-0.19.2.min.js"></script>
<script src="js/layer.js"></script>
<script>
    new Vue({
        data: {},
        methods: {
            toLogin: function () {
                axios({
                    method: "get",
                    url: "/wx/getWxUserInfo"
                }).then(res => {
                    if (res.data.flag) {
                        //存入localStorage
                        localStorage.setItem("loginUser", JSON.stringify(res.data.data));
                        location.href = "/home.html";
                    } else {
                        this.codeImg = this.codeImg + "?" + new Date();
                        layer.msg(res.data.message);
                    }
                });
            }
        },
        created: function () {
            this.toLogin();
        }
    })
</script>

</html>